package com.zilu.digitaltwin.dto;

import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: FloorInfoDTO
 * @Description:
 * @Author: 段振宇
 * @Date: 2023/1/9 15:52
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class FloorInfoDTO {

    private String floorNum;

    private JSONObject feature;

    private List<RoomInfoDTO> roomList;


    public List<RoomInfoDTO> getRoomList() {
        if (null == roomList) {
            roomList = new ArrayList<>();
        }
        return roomList;
    }

    public Float getFloorStartHeight() {
        return this.getRoomList().size() > 0 ? roomList.get(0).getFloorStartHeight() : null;
    }

    public Float getFloorEndHeight() {
        return this.getRoomList().size() > 0 ? roomList.get(0).getFloorEndHeight() : null;
    }

}
